<?php

    require_once dirname(dirname(__FILE__)) . '/config/config.php';
    require_once DOCUMENT_ROOT . DIR_SHARED_CONFIG . 'connection.php';

    /**
     * User: Viet Anh
     * Date: 06/06/2014
     * Time: 20:44
     */
    class dao_tran_history
    {

        public function get_tran_history_of_user($user_id)
        {
            $db  = new connection();
            $con = $db->open_connect();

            $query = "SELECT * FROM tbl_transaction_history WHERE user_id = $user_id";
            $result = mysqli_query($con, $query) or die(mysqli_error());
            $list = array();

            while ($row = mysqli_fetch_array($result)) {
                array_push($list, $row);
            }

            $db->close_connect();

            return $list;
        }
    }